import java.io.*;
import java.util.ArrayList;
import java.util.List;

public class StopWords 
{
	private static boolean isInited = false;
	private static void Init()  {
		InputStreamReader read = null;
		try {
			//read = new InputStreamReader(new FileInputStream(new File(StopWords.class.getResource("StopWords.txt").getFile())),"utf8");
			read = new InputStreamReader(new FileInputStream("D:\\所有程序\\程存淦\\Java\\Yejishuominghui\\target\\StopWords.txt"));
		}
//		catch (UnsupportedEncodingException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
		catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}//考虑到编码格式
        BufferedReader bufferedReader = new BufferedReader(read);
        String line = null;
		try {
			while((line = bufferedReader.readLine())!=null){
				list.add(line.trim());
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	private static List<String> list = new ArrayList<String>(); 
	public static Boolean contains(String word){
		if(!isInited){ 
			Init();
			isInited = true; 
		}
		if(word.length()>=100){
			return true;
		}
		return list.contains(word);
	}
}
